
from django.conf.urls import url,include
from django.contrib.staticfiles.views import serve
from web.views import home,account,other,project,dashboard,issues,total,wiki,file,setting,mycharts

urlpatterns = [
    url('favicon.ico', serve, {'path': '/static/img/favicon.ico'}),

    url(r'^home/$',home.index,name="home"),# 首页

    url(r'^register/$', account.register,name='register'),# 加上name方便后期模板里面的反向解析
    url(r'^send/sms/',account.send_sms,name="send_sms"),
    url(r'^login/$',account.login,name='login'),
    url(r'^img/checkcode/$',account.img_check_code,name='imgcheckcode'),
    url(r'^login/sms/$',account.login_sms,name='login_sms'),
    url(r'^login/out/$',account.login_out,name='login_out'),


    url(r'^project/list/$', project.project_list, name='project_list'),
    url(r'^project/star/(?P<project_type>\w+)/(?P<project_id>\d+)/$', project.project_star, name='project_star'),
    url(r'^project/unstar/(?P<project_type>\w+)/(?P<project_id>\d+)/$', project.project_unstar, name='project_unstar'),
    url(r'^manage/(?P<project_id>\d+)/', include([
        url(r'^dashboard/$', dashboard.dashboard, name='dashboard'),
        url(r'^mychart/c01/$', mycharts.mychart01, name='mychart01'),
        url(r'^issues/$', issues.issues, name='issues'),
        url(r'^issues/detail/(?P<issues_id>\d+)/$', issues.issues_detail, name='issues_detail'),
        url(r'^issues/reply/(?P<issues_id>\d+)/$', issues.issues_reply, name='issues_reply'),
        url(r'^issues/change/(?P<issues_id>\d+)/$', issues.issues_change, name='issues_change'),
        url(r'^invite/url/$', issues.invite_url, name='invite_url'),
        url(r'^total/$', total.total, name='total'),
        url(r'^wiki/$', wiki.wiki, name='wiki'),
        url(r'^wiki/add/$', wiki.wiki_add, name='wiki_add'),
        url(r'^wiki/catalog/$', wiki.wiki_catalog, name='wiki_catalog'),
        url(r'^wiki/edit/(?P<wiki_id>\d+)/$', wiki.wiki_edit, name='wiki_edit'),
        url(r'^wiki/delete/(?P<wiki_id>\d+)/$', wiki.wiki_delete, name='wiki_delete'),
        url(r'^wiki/uploads/(?P<wiki_id>\d+)/$', wiki.wiki_uploads, name='wiki_uploads'),
        url(r'^file/$', file.file, name='file'),
        url(r'^file/upload/$', file.file_uploads, name='file_uploads'),
        url(r'^file/download/(?P<file_id>\d+)/$', file.file_download, name='file_download'),
        url(r'^file/delete/$',file.file_delete,name='file_delete'),
        url(r'^file/folder/(?P<folder_id>\d+)/$', file.folder_edit, name='folder_edit'),
        url(r'^setting/$', setting.setting, name='setting'),
        url(r'^setting/delete/$', setting.setting_delete, name='setting_delete'),
    ], None, None)),
    # url(r'^dashboard/(?P<project_id>\d+)/dashboard/$', dashboard.dashboard, name='dashboard'),
    url(r'invite/join/(?P<code>\w+)/$',issues.invite_join,name="invite_join"),
    url(r'^[\W\w]*$', other.error,name="error_url"),  # 正则配置最终路由接收异常请求, 一定要放在最后

]
